package io.github.kimmking.kkconfig.repository;

import io.github.kimmking.kkconfig.spring.ConfigMeta;
import lombok.Getter;

import java.util.HashMap;
import java.util.Map;

/**
 * Description for this class.
 *
 * @Author : kimmking(kimmking@apache.org)
 * @create 2024/4/19 01:23
 */
public interface KKRepository {

    Map<String, String> LAST_CONFIG = new HashMap<>();
    Map<String, Long> LAST_TIMESTAMP = new HashMap<>();

    Map<String, String> getConfig();

    void addChangeListener(KKRepositoryChangeListener<Map<String, String>> listener);

    static KKRepository getDefault(ConfigMeta meta) {
        return new KKRepositoryImpl(meta);
    }

}
